<?php
/**
 * class App_Controller_Place
 *
 * @author kim
 */
class App_Controller_Place extends Zend_Controller_Action
{
    /**
     * browse places
     */
    public function indexAction()
    {
    }

    /**
     * add place
     */
    public function addAction()
    {
    }

    /**
     * search place
     *
     * @todo searching things should use Zend_Lucene component !!!
     */
    public function searchAction()
    {
        // search form object
        $form = new App_Form_Place_Search();

        if ($this->getRequest()->isPost()) {
            $data = $this->getRequest()->getPost();

            // validate post data
            if ($form->isValid($data)) {
                $place = new App_Model_Place();
                $result = $place->getSearchResult($form->getValues());
                if (count($result)) {
                }
            } else {
                $form->populate($data);
            }
        }

        $this->view->formSearch = $form;
    }

    /**
     * to view a place
     */
    public function viewAction()
    {
    }

}
